package com.manager.system.service.impl;

import com.manager.common.dao.SuperDao;
import com.manager.common.utils.MD5;
import com.manager.model.System_User;
import com.manager.system.service.LoginService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class LoginServiceImpl extends SuperDao<Object> implements LoginService {


    @Override
    public System_User login(String username, String password) {
        String sql = " from System_User t where t.userName = ?1 and t.password = ?2 and t.hasOpen = 1  ";
        password = MD5.getMD5(password.getBytes());
        System_User systemUser = this.getListOne(sql,new Object[]{username,password},"",System_User.class);
        return systemUser;
    }
}
